#ifndef UTIL_SHARED_PTR_EXAMPLE_H
#define UTIL_SHARED_PTR_EXAMPLE_H

#include <iostream>
#include "smart_ptr.h"

using namespace util;

struct Shoe
{
	~Shoe()	{ std::cout << "Buckle my shoe\n"; }
};

class MyClass
{
    scoped_ptr<int> ptr;

public:
    MyClass() : ptr(new int) { *ptr = 0; }
    int add_one() { return ++*ptr; }
};

int main()
{
    scoped_ptr<Shoe> x(new Shoe);
    
    MyClass instance;
    
    std::cout << instance.add_one() << '\n';
    std::cout << instance.add_one() << '\n';
    
    return 0;
}

#endif // UTIL_SHARED_PTR_EXAMPLE_H
